home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / CDTools / S / AAExtract < prev    next >
Text File  |  2000-11-08  |  2KB  |  48 lines

  1. /*
  2.     Extracts files from archives on the CD
  3.     $VER: AAExtract 1.1 (15.12.99)
  4.     (c) Neil Bothwick, Wirenet
  5. */
  6.  
  7. address command
  8. options results
  9. call addlib('rexxsupport.library',0,-30,0)
  10. call addlib('rexxdossupport.library',0,-30,0)
  11. options failat 21
  12. ExtractPath = 'RAM:'
  13. ExtractPath = AddPart(ExtractPath,'')
  14. CDName = pragma('D')
  15. parse var CDName CDName ':' .
  16. if left(CDName,4) ~= 'AACD' then CDName = 'AACD'
  17.  
  18. parse arg Archive
  19. Ext = upper(substr(Archive,lastpos('.',Archive) + 1))
  20.  
  21. select
  22.     when pos(Ext,'LHA LZH') > 0 then do
  23.         'LhA x "'Archive'" "'ExtractPath'"'
  24.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  25.         else 'rx REXX:AAShowDir' ExtractPath
  26.         end
  27.     when pos(Ext,'DOC TXT README GUIDE') then 'AACDFile "'Archive'"'
  28.     when Ext = 'TGZ' then do
  29.         'UnTGZ x "'Archive'" "'ExtractPath'"'
  30.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  31.         else 'rx REXX:AAShowDir' ExtractPath
  32.         end
  33.     when Ext = 'ZIP' then do
  34.         'UnZIP x "'Archive'" "'ExtractPath'"'
  35.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  36.         else 'rx REXX:AAShowDir' ExtractPath
  37.         end
  38.     /* when Ext = 'DMS' then */
  39.     when pos(Ext,'MPG ANIM GIF JPEG JPG PNG') > 0 then 'AACDFile "'Archive'"'
  40.     otherwise do
  41.         'copy "'Archive'" "'ExtractPath'" clone quiet'
  42.         if RC > 0 then 'RequestChoice >NIL: "Amigactive CD" "An error occured*Nwith this archive" "OK"'
  43.         else 'rx REXX:AAShowDir' ExtractPath
  44.         end
  45.     end
  46.  
  47.  
  48.